Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add commercial support, fix WASM and issues with Qt 6.7.+ #272

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Kidev
Copy link

@Kidev Kidev commented Dec 18, 2024

This PR includes

  • Updates to parameters and logic to handle the latest aqtinstall versions, making the action once again able to install any version of Qt, WASM and extensions included
  • Add full support for installing Qt commercial versions provided you own a Qt account (paid or not). The account is required even if you only download open-source versions

Context

Since Qt 6.7+, the Qt team decided to make WASM a part of all_os as host, with target wasm. This is sensible as the WASM version of Qt cannot work on its own and needs a host. To install Qt WASM for the latest versions, it is now required to use the action like this:

- name: Install Qt for host and WASM
  uses: jurplel/install-qt-action@v4
  with:
    version: '6.8.1'
    host: 'all_os'
    target: 'wasm'
    arch: 'wasm_singlethread'
    modules: 'all'

This change is required by the latest versions of aqtinstall (3.2.*)

Working examples:

  • Latest Qt WASM:
- name: Install Qt
  uses: Kidev/[email protected]
  with:
    version: '6.8.1'
    target: 'all_os'
    arch: 'wasm'
    modules: 'qtquick3d'
- name: Install Qt
  uses: Kidev/[email protected]
  with:
    version: '6.8.1'
    target: 'desktop'
    arch: 'linux_gcc_64'
    use-commercial: true
    user: ${{ secrets.QT_USERNAME }}
    password: ${{ secrets.QT_PASSWORD }}
    modules: 'qtquick3d'

Unverified

This user has not yet uploaded their public signing key.
… as host and 'wasm' as target
@jdpurcell
Copy link
Contributor

@Kidev install-qt-action already passes --autodesktop, it's just that it doesn't typically work if you specify aqtsource as you were probably doing for testing. The logic for when it passes in the parameter is determined by:

const isAutodesktopSupported = async (): Promise<boolean> => {
  const rawOutput = await getPythonOutput("aqt", ["version"]);
  const match = rawOutput.match(/aqtinstall\(aqt\)\s+v(\d+\.\d+\.\d+)/);
  return match ? compareVersions(match[1], ">=", "3.0.0") : false;
};

The problem is, if you point aqtsource at a branch on your Git repo, due to aqt's use of setuptools-scm, the version is auto-generated like v0.1.dev1823 so the regex doesn't match it due to the letters, and it falls to the : false expression of the ternary conditional operator. In my opinion that should be changed to : true to allow easier use with aqtsource.

Right now as you discovered, one either needs to pass extra: '--autodesktop', or only point aqtsource to a version tag that satisfies the version expectation. For example when I was testing some things with aqt, I created a fake version tag like v3.1.100 for use with aqtsource so that setuptools-scm would auto-assign it that version.

@Kidev
Copy link
Author

Kidev commented Dec 21, 2024

Indeed, I'll remove it from the README and such then. In the meantime I got it all working, as you can see in this workflow file of a project of mine. You can check the latest run here. You can use it right now if you need to, no need to wait for either PRs:

- name: Install Qt for host architecture
  uses: Kidev/[email protected]
  with:
    version: '6.8.1'
    host: 'all_os'
    target: 'wasm'
    arch: 'wasm_singlethread'
    set-env: 'true'
    modules: 'qtquick3d'
    aqtsource: 'git+https://github.com/Kidev/aqtinstall.git@wasm'
    extra: '--autodesktop'

@Kidev Kidev mentioned this pull request Dec 22, 2024
@crueter
Copy link

crueter commented Jan 2, 2025

@Kidev My application depends on Qt Quick, and this doesn't seem to properly install it for WASM or Android.

Failed to find required Qt component "Quick".

Here's my config:

- name: Install Qt (Host)
  uses: Kidev/[email protected]
  with:
    cache: on
    version: 6.8.1

- name: Install Qt (WASM)
  if: // ...
  uses: Kidev/[email protected]
  with:
    cache: on
    host: all_os
    target: wasm
    version: 6.8.1
    arch: wasm_singlethread
    set-env: true
    modules: 'qtquick3d'
    aqtsource: 'git+https://github.com/Kidev/aqtinstall.git@wasm'

Why is Quick not getting installed?

Actually, scrolling up, it can't find Qt core...

Found package configuration file:

    /.../lib/cmake/Qt6Quick/Qt6QuickConfig.cmake

  but it set Qt6Quick_FOUND to FALSE so package "Qt6Quick" is considered to
  be NOT FOUND.  Reason given by package:

  Qt6Quick could not be found because dependency Qt6Core could not be found.

...because it can't find Qt6CoreTools.

Found package configuration file:

    /.../lib/cmake/Qt6Core/Qt6CoreConfig.cmake

  but it set Qt6Core_FOUND to FALSE so package "Qt6Core" is considered to be
  NOT FOUND.  Reason given by package:

  Qt6Core could not be found because dependency Qt6CoreTools could not be
  found.

@crueter
Copy link

crueter commented Jan 2, 2025

Nevermind, I had the wrong host paths set in my configure command.

@Kidev
Copy link
Author

Kidev commented Jan 6, 2025

The PR fixing WASM and more was merged into master and aqtinstall will soon release its version 3.2.0 including those changes. For it to work, I updated the default value of aqtversion to 3.2.*. I also updated the default value of version to the only Qt LTS version remaining (6.8.1). My temporary version of the Action is available here. Note the version v4.2.1 will only work once the release is published (I will update once it is the case). Until then you must still use v4.2.0.

Note

Until the release 3.2.0 of aqtinstall is published, use:

- name: Install Qt for host architecture
  uses: Kidev/[email protected]
  with:
    version: '6.8.1'
    host: 'all_os'
    target: 'wasm'
    arch: 'wasm_singlethread'
    aqtsource: 'git+https://github.com/miurahr/aqtinstall.git'
    extra: '--autodesktop'

Here is a working deploy as example

Note

Once the release 3.2.0 of aqtinstall is published, use:

- name: Install Qt for host architecture
  uses: Kidev/[email protected]
  with:
    version: '6.8.1'
    host: 'all_os'
    target: 'wasm'
    arch: 'wasm_singlethread'

@Kidev Kidev changed the title To fix issues with Qt 6.7+ and match with aqtinstall, allows 'all_os' for host and 'wasm' for target Fix WASM and issues with Qt 6.7.+ Jan 6, 2025
@xavier2k6
Copy link
Contributor

py7zr default could probably be bumped as well to ==0.22.* to coincide with aqtinstall/dependencies.

https://github.com/miurahr/aqtinstall/blob/master/pyproject.toml#L29

@xavier2k6
Copy link
Contributor

BTW: I have PR #267 Open for the python-version range, thoughts?

@Kidev
Copy link
Author

Kidev commented Jan 6, 2025

BTW: I have PR #267 Open for the python-version range, thoughts?

It is a good idea, I also have updated it in my latest update, along with py7zr.

It is not yet ready for this PR, still need some testing, but I'm working on getting commercial versions available to the installation using this Action (miurahr/aqtinstall#878 https://github.com/Kidev/install-qt-action). Here you can see a successful install of Qt using the use-commercial feature (note the install succeeds, but the workflow fails because as of today, addons are not yet supported by the use-commercial feature. It is work in progress though)

image

@Kidev Kidev changed the title Fix WASM and issues with Qt 6.7.+ AddFix WASM and issues with Qt 6.7.+ Jan 27, 2025
@Kidev Kidev changed the title AddFix WASM and issues with Qt 6.7.+ Add commercial support, fix WASM and issues with Qt 6.7.+ Jan 27, 2025
@Kidev
Copy link
Author

Kidev commented Jan 27, 2025

Added working support for Qt commercial.

You can see an example using my version of the workflow
It uses my version of install-qt-action (v4.4.2) while this PR is not merged

You can use it right now yourself like this, until this PR is merged:

- name: Install Qt
  uses: Kidev/[email protected]
  with:
    version: '6.8.1'
    target: 'desktop'
    arch: 'linux_gcc_64'
    aqtsource: 'git+https://github.com/miurahr/aqtinstall'
    use-commercial: true
    user: ${{ secrets.QT_USERNAME }}
    password: ${{ secrets.QT_PASSWORD }}
    modules: 'qtquick3d'

jurplel and others added 3 commits February 12, 2025 21:34
@Kidev
Copy link
Author

Kidev commented Feb 13, 2025

Fixed the issue after the re-sync, and some force push shenanigans to run the workflows on my repo too

@Kidev
Copy link
Author

Kidev commented Feb 13, 2025

Update: @jurplel almost all tests pass on my repo. There are issues with the windows-2019 runner however. I'm pretty sure it's because of MSVC2019, that is no longer supported by aqtinstall (see here for the discussion with the maintainer and other contributors of aqtinstall).

The commercial PR can be found here for more info.

Caution

The docs and some commands have changed, I'll update this soon, along with some tests

@jdpurcell
Copy link
Contributor

@Kidev Will you be changing the YAML syntax (input parameter name) e.g. from use-commercial: true to use-official: true to match the recent naming change in aqtinstall? I'm just concerned that if this is merged/released now, and then the parameter name changes, that should be a new major version of this action since it breaks backwards compatibility.

Perhaps it's worth finalizing the YAML syntax now (even if it's still passing the old argument names to aqtinstall, since the renames haven't been released yet), or marking this as a draft if you'd rather wait for the next aqtinstall release, so there's no concern with the YAML backwards compatibility.

@Kidev
Copy link
Author

Kidev commented Feb 24, 2025

@Kidev Will you be changing the YAML syntax (input parameter name) e.g. from use-commercial: true to use-official: true to match the recent naming change in aqtinstall? I'm just concerned that if this is merged/released now, and then the parameter name changes, that should be a new major version of this action since it breaks backwards compatibility.

Perhaps it's worth finalizing the YAML syntax now (even if it's still passing the old argument names to aqtinstall, since the renames haven't been released yet), or marking this as a draft if you'd rather wait for the next aqtinstall release, so there's no concern with the YAML backwards compatibility.

That is a nice idea indeed, I would not have done that. I'm doing it right now along with the changes in commands to aqtinstall, been quite busy the last 2 weeks or so

@jurplel
Copy link
Owner

jurplel commented Feb 27, 2025

@Kidev Will you be changing the YAML syntax (input parameter name) e.g. from use-commercial: true to use-official: true to match the recent naming change in aqtinstall? I'm just concerned that if this is merged/released now, and then the parameter name changes, that should be a new major version of this action since it breaks backwards compatibility.
Perhaps it's worth finalizing the YAML syntax now (even if it's still passing the old argument names to aqtinstall, since the renames haven't been released yet), or marking this as a draft if you'd rather wait for the next aqtinstall release, so there's no concern with the YAML backwards compatibility.

That is a nice idea indeed, I would not have done that. I'm doing it right now along with the changes in commands to aqtinstall, been quite busy the last 2 weeks or so

This sounds good to me—after CI is passing (which I believe it should do if you merge/rebase off of main), we should be good to merge this, then merge @jdpurcell's ARM64 hosts PR

@Kidev
Copy link
Author

Kidev commented Feb 27, 2025

This should be good, I'm testing on my repo as usual. Same as last time, it works on the official repo since my PR on aqtinstall was merged, BUT it is NOT YET RELEASED in a version. So adding this is required until it is the case:

aqtsource: 'git+https://github.com/miurahr/aqtinstall.git@master'

Comment on lines +91 to +92
email: '****@gmail.com'
pw: '****'
Copy link
Contributor

@jdpurcell jdpurcell Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kidev Or perhaps (to prevent any unfortunate mistakes 😅):

Suggested change
email: '****@gmail.com'
pw: '****'
email: ${{ secrets.QT_EMAIL }}
pw: ${{ secrets.QT_PW }}

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '5.15.3'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update this bit of docs with new default settings

@jurplel
Copy link
Owner

jurplel commented Feb 28, 2025

This should be good, I'm testing on my repo as usual. Same as last time, it works on the official repo since my PR on aqtinstall was merged, BUT it is NOT YET RELEASED in a version. So adding this is required until it is the case:

aqtsource: 'git+https://github.com/miurahr/aqtinstall.git@master'

I think we can merge soon but hold off on releasing this until the new aqtinstall version drops. I wish we had a way to test this, but I guess since it is a commercial version, there is not really an easy way since we need credentials...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants